<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <!-- 
    align-items:设置item在交叉轴的对齐

                flex-start:将item在交叉轴start位置对齐
                center：将item在交叉轴中间位置对齐
                flex-end：将item在交叉轴end结束位置对齐
                stretch (默认)：前提item没有设置高度，
                                会自动拉伸至填充flex
                                （如果item没有设置高度，或者高度为auto,将占满整个容器）
  -->

  <!-- flex-start:将item在交叉轴start位置对齐 -->
  <style>
    .flex-start{
      display: flex;
      height: 200px;
      border: 1px solid;
      align-items: flex-start;
    }
    span{
      height: 50px;
      width:  50px;
      background-color: #ccc;
      border: 1px solid;
    }
  </style>
  <h2>align-items:flex-start</h2>
  <div class="flex-start">
    <span>start</span>
    <span>center</span>
    <span>end</span>
  </div>





  <!-- center：将item在交叉轴中间位置对齐 -->
  <style>
    .center{
      display: flex;
      height: 200px;
      border: 1px solid;
      align-items: center;
    }
    span{
      height: 50px;
      width:  50px;
      background-color: #ccc;
      border: 1px solid;
    }
  </style>
  <h2>align-items:center</h2>
  <div class="center">
    <span>start</span>
    <span>center</span>
    <span>end</span>
  </div>



  

  <!--  flex-end：将item在交叉轴end结束位置对齐 -->
  <style>
    .flex-end{
      display: flex;
      height: 200px;
      border: 1px solid;
      align-items: flex-end;
    }
    span{
      height: 50px;
      width:  50px;
      background-color: #ccc;
      border: 1px solid;
    }
  </style>
  <h2>align-items:flex-end</h2>
  <div class="flex-end">
    <span>start</span>
    <span>center</span>
    <span>end</span>
  </div>




  <!-- 
    stretch (默认)：前提item没有设置高度，
                    会自动拉伸至填充flex
                   (如果item没有设置高度，或者高度为auto,将占满整个容器） 
  -->
  <style>
    .stretch{
      height: 100px;
      display: flex;
      border: 1px solid;
    }
    .stretch div{
      width: 100px;
      background-color: #ccc;
      border: 1px solid;
    }
  </style>
  <h2>align-items:stretch</h2>
  <div class="stretch">
    <div>start</div>
    <div>center</div>
    <div>end</div>
  </div>

</body>
</html>